1. Field of the Invention
The present invention relates to a data processing apparatus furnished with a non-volatile memory and to a data processing method, and more particularly to a data processing technology used for engine control.
2. Description of the Prior Art
When developing electronic control unit (hereafter, abbreviated as ECU) of an automobile, it is necessary to tune parameters for programs and data that are stored in internal flash ROMs (Flash Read Only Memories) which are used for controlling systems so that it is possible to obtain desired characteristics.
Conventional tuning methods employ a method in which a single chip microcomputer having a parallel input/output port or a serial input/output port is operated in a dedicated mode to rewrite the flash ROM. However, the conventional methods have problems in that, because they are not provided with the function for performing rewriting the flash ROM when an ECU is actually operating, the flash ROM cannot be rewritten when the ECU is actually operating. If it becomes possible to rewrite data and correct programs instantly in environmental conditions where experimental environments are difficult to reproduce, it becomes easy to obtain targeted characteristics.
In view of these, Japanese Unexamined Patent Publication No. 10-020906 discloses a data processing system that enables quick tuning without necessitating shutdown of operating power supply or shutdown of the computer system in data processing used for engine control when developing engines.
FIG. 1 shows a block diagram of a prior art data processing apparatus described in the foregoing publication. This data processing apparatus 109 has a central processing unit (hereinafter, abbreviated as CPU) core 101 for executing a control program, a PROM (Programmable Read Only Memory) 102 in which a control program and a control parameter are stored in advance, a RAM (Random Access Memory) 103, a data transfer means 104 for transferring data from an external terminal 100 to the RAM 103, a register 105 that stores the transfer addresses, and a comparator 106 that can be switched between an operating state and a non-operating state and compares a value in the register 105 and an address value which is output from the CPU core 101, all of which are connected to one another through a data bus 107 and an address bus 108. The data transfer means 104 has a serial transmitter 112, a direct memory access (DMA) 113, and a decoder 114.
When data tuning is performed by reading a new control parameter from outside into this data processing apparatus, command data indicating writing to the RAM, RAM address data, and new parameter data are first inputted to the external terminal 100. When these data are read by the serial transmitter 112, the decoder 114 judges from the read data that a control parameter has been read. As a result, the comparator 106 enters a non-operating state, and the RAM address and the new parameter data are passed to the DMA 113.
Upon receiving the new parameter data, the DMA 113 requests bus ownership to the CPU 101. After having been granted the bus ownership, the DMA 113 makes a RAM selecting-signal 110 valid and a PROM-selecting signal 111 invalid irrespective of the state of the comparator 106, and writes the control parameter into an aimed address in the RAM 103.
After having written data, the DMA 113 restores the RAM selecting-signal 110 and the PROM-selecting signal 111 to their original states, tells the CPU core 101 of its relinquishment of the bus ownership, and instructs the serial transmitter 112 to read the next data. The new control parameter is written into the RAM 103 by repeating these steps.
When the CPU core 101 attempts, under this condition, to access a region in which control parameters are stored, the CPU core 101 accesses a region of the RAM 103 in which the new parameter is written, not a region of the PROM 102; thus engine control is carried out. If the control parameter needs to be further changed to continue the tuning, the control parameter can be changed one after another during operation-by performing a similar operation such that new control parameters are read from outside into the RAM.
Accordingly, when developing, for example, an ECU, it becomes possible to optimize programs and data tables under conditions in which reproduction is difficult in actual operating environments. In addition, it becomes possible to instantly rewrite data and correct programs under conditions in which reproduction is difficult.
The conventional data processing system depicted in FIG. 1 makes it possible to change parameter data even during the operation of the CPU core and to perform quick tuning without shutting down the operating power supply for the CPU core or shutting down the computer system, because the CPU core 101 is configured such that, when the RAM 103 is rewritten and a data store address is output during the operation of the CPU core 101, the CPU core 101 refers to the data stored in the RAM 103 in place of the data stored in the PROM 102 to execute programmed operations. However, the new control parameter stored in the RAM 103 needs to be written again into the PROM 102 after the tuning is completed. For this reason, the operation is cumbersome and errors tend to occur.
Moreover, since the RAM 103 temporarily stores all the control parameters that are changed by the time the tuning is completed, a large capacity memory region is required for the RAM 103, which is undesirable.